import {
	modal
} from 'vue-strap'
import {
	manualImportExcel,
  showMsg
} from '../../../../vuex/action.js'

export default {
	data() {
		return {
			showManualExcel: false,
			excelParam: {
				excel: ''
			}
		}
	},
	vuex: {
		actions: {
			xManualImportExcel: manualImportExcel,
      xShowMsg: showMsg
		}
	},
	methods: {
		evtShowManulExcel() {
			this.showManualExcel = true
		},
		submit() {
			let formData = new FormData()
			formData.append('excel', this.$els.file.files[0])

			this.xManualImportExcel(formData)
				.then((res) => {
          this.showManualExcel = false
				})
        .catch((res) => {
          this.xShowMsg({
            type: 'danger',
            content: res.error_msg
          })
        })
		}
	},
	components: {
		'vue-modal': modal
	}
}
